package frontend;

/**
 * Interface definition: FrontEnd.
 * 
 * @author OpenORB Compiler
 */
public class _FrontEndStub extends org.omg.CORBA.portable.ObjectImpl
        implements FrontEnd
{
    static final String[] _ids_list =
    {
        "IDL:FE/FrontEnd:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = frontend.FrontEndOperations.class;

    /**
     * Operation createPlayerAccount
     */
    public void createPlayerAccount(String firstName, String lastName, short age, String username, String password, String iPAddress, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder status)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("createPlayerAccount",true);
                    _output.write_string(firstName);
                    _output.write_string(lastName);
                    _output.write_short(age);
                    _output.write_string(username);
                    _output.write_string(password);
                    _output.write_string(iPAddress);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    status.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("createPlayerAccount",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.createPlayerAccount( firstName,  lastName,  age,  username,  password,  iPAddress,  result,  status);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation playerSignIn
     */
    public void playerSignIn(String userName, String password, String iPAddress, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder status)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("playerSignIn",true);
                    _output.write_string(userName);
                    _output.write_string(password);
                    _output.write_string(iPAddress);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    status.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("playerSignIn",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.playerSignIn( userName,  password,  iPAddress,  result,  status);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation playerSignOut
     */
    public void playerSignOut(String userName, String iPAddress, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder status)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("playerSignOut",true);
                    _output.write_string(userName);
                    _output.write_string(iPAddress);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    status.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("playerSignOut",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.playerSignOut( userName,  iPAddress,  result,  status);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation transferAccount
     */
    public void transferAccount(String userName, String password, String OldiPAddress, String NewiPAddress, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder status)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("transferAccount",true);
                    _output.write_string(userName);
                    _output.write_string(password);
                    _output.write_string(OldiPAddress);
                    _output.write_string(NewiPAddress);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    status.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("transferAccount",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.transferAccount( userName,  password,  OldiPAddress,  NewiPAddress,  result,  status);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getPlayerStatus
     */
    public void getPlayerStatus(String adminUsername, String adminPassword, String iPAddress, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder playersStatus)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getPlayerStatus",true);
                    _output.write_string(adminUsername);
                    _output.write_string(adminPassword);
                    _output.write_string(iPAddress);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    playersStatus.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getPlayerStatus",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.getPlayerStatus( adminUsername,  adminPassword,  iPAddress,  result,  playersStatus);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation suspendAccount
     */
    public void suspendAccount(String adminUsername, String adminPassword, String iPAddress, String UsernameToSuspend, org.omg.CORBA.BooleanHolder result, org.omg.CORBA.StringHolder status)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("suspendAccount",true);
                    _output.write_string(adminUsername);
                    _output.write_string(adminPassword);
                    _output.write_string(iPAddress);
                    _output.write_string(UsernameToSuspend);
                    _input = this._invoke(_output);
                    result.value = _input.read_boolean();
                    status.value = _input.read_string();
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("suspendAccount",_opsClass);
                if (_so == null)
                   continue;
                frontend.FrontEndOperations _self = (frontend.FrontEndOperations) _so.servant;
                try
                {
                    _self.suspendAccount( adminUsername,  adminPassword,  iPAddress,  UsernameToSuspend,  result,  status);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
